﻿package tests;
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;

class GenericTest extends Sprite
{
	var _tf:TextField;
	
	public function new()
	{
		super();
		_tf = new TextField();
		_tf.autoSize = TextFieldAutoSize.LEFT;
		addChild(_tf);
		
		addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
	}
	
	function out(value:Dynamic)
	{
		_tf.text += value + '\n';
	}
	
	function onAddedToStage(e:Event)
	{
		removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
		stage.addEventListener(Event.RESIZE, onStageResize);
		init();
		onStageResize();
	}
	
	function init()
	{
		
	}
	
	function onStageResize(e:Event = null)
	{
		resize(stage.stageWidth, stage.stageHeight);
	}
	
	function resize(width:Float, height:Float)
	{
		
	}
}